﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SchoolLibrary.Entity;
using System.Data;

namespace SchoolLibrary.DataBase.Builder
{
    public class GenreBuilder : AbstractEntityBuilder
    {
        public override Identity Build(DataRow row)
        {
            Genre pupil = new Genre();
            BuildEntity(pupil, row);
            return pupil;
        }

        protected override void BuildEntity(Identity entity, DataRow row)
        {
            base.BuildEntity(entity, row);
            Genre genre = (Genre)entity;
            genre.Name = row[Genre.NAME_COLUMN_NAME].ToString();
        }
    }
}
